package top.luckyluxcis.api;

import lombok.experimental.UtilityClass;
import top.luckyluxcis.RollApi;
import top.luckyluxcis.type.Rubbish;
import top.luckyluxcis.util.MapUtil;

import java.util.Map;

/**
 * @author Zhuang
 * @since 2023/9/25
 */
@SuppressWarnings("unused")
@UtilityClass
public class RubbishUtil {
    private static final RollApi API = RollApi.getInstance();

    /**
     * 查询指定物品垃圾分类信息。
     *
     * @param name 物品名称，必传
     * @return {@link Rubbish}
     */
    public static Rubbish search(String name) {
        Map<String, Object> params = MapUtil.<String, Object>builder()
                .put("name", name)
                .build();
        return API.get("/rubbish/type", params, Rubbish.class);
    }
}
